package hello

import (
	"fmt"
)

func main() {
	// var num = 100
	// num = num + 1
	// fmt.Println(num)
	// fmt.Println("hello world!")
	fmt.Print(Hello("tom", ""))
}

func Hello(name string, language string) string {
	if name == "" {
		name = "World"
	}
	return getLanguage(language) + name
}

const englishHelloPrefix = "Hello, "
const chineseHelloPrefix = "你好, "
const frenchHelloPrefix = "Bonjour, "

func getLanguage(language string) (prefix string) {
	switch language {
	case "chinese":
		prefix = chineseHelloPrefix
	case "french":
		prefix = frenchHelloPrefix
	case "english":
		prefix = englishHelloPrefix
	default:
		prefix = "hi, "
	}
	return
}
